//
//  ViewController.m
//  广告滚动
//
//  Created by sks on 16/4/20.
//  Copyright © 2016年 sks. All rights reserved.
//

#import "ViewController.h"
#import "ScrollerView.h"
@interface ViewController (){
  ScrollerView *_NetScrollView;
}
/** 网络图片数组*/
@property(nonatomic,strong)NSArray *NetImageArray;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //滚动视图
    //网络加载
    /** 设置网络scrollView的Frame及所需图片*/
    _NetScrollView = [[ScrollerView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200) WithNetImages:self.NetImageArray];
    
    /** 设置滚动延时*/
    _NetScrollView.AutoScrollDelay = 3;
    
    /** 设置占位图*/
    _NetScrollView.placeholderImage = [UIImage imageNamed:@"mycollege"];
    
    
    /** 获取网络图片的index*/
    _NetScrollView.netDelagate = self;
    
    _NetScrollView.pageIndicatorColor = [UIColor redColor];
    _NetScrollView.currentPageIndicatorColor = [UIColor yellowColor];
    _NetScrollView.pagestyle = pageRight;
    
    /** 添加到当前View上*/
    [self.view addSubview:_NetScrollView];
}



-(NSArray *)NetImageArray
{
    if(!_NetImageArray)
    {
        _NetImageArray = @[@"http://img.ivsky.com/img/bizhi/slides/201512/18/biaobai_wenzi.jpg",@"http://g.hiphotos.baidu.com/image/h%3D200/sign=915fb1b0412309f7f86faa12420e0c39/caef76094b36acaff0c832d87bd98d1001e99cee.jpg",@"http://img.ivsky.com/img/bizhi/pre/201601/08/cts_v-006.jpg"];
    }
    return _NetImageArray;
}
/** 获取网络图片的index*/
-(void)didSelectedNetImageAtIndex:(NSInteger)index
{
    NSLog(@"点中网络图片的下标是:%ld",(long)index);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
